<?
//获得数据库表格中最旧或者最新的时间:
//$item:记录日期时间的项
//table:表格名称
//condition:最新的还是最旧的
//例子:sum_total("finance","applydate","new")

function get_limit_date($table,$item,$condition)
{

if($condition=="new")
{$condition="desc";}
else
{$condition="asc";}

  $sqlstr="select $item from $table order by $item $condition";
  $values = mysql_result(mysql_query($sqlstr), 0);

return $values;

}


?>

